package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFaRevisitTaskDao;
import com.financing.platform.dto.FaRevisitTaskDTO;
import com.financing.platform.service.IFaRevisitTaskService;
/**
 * fa_revisit_task  
 * 客户发送短信待办事项流水 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("faRevisitTaskService")
public class FaRevisitTaskServiceImpl implements IFaRevisitTaskService{

	@Autowired
	private IFaRevisitTaskDao faRevisitTaskDao;

	@Override
	public int insert(FaRevisitTaskDTO faRevisitTask) throws SQLException {
		return faRevisitTaskDao.insert(faRevisitTask);
	}

	@Override
	public void update(FaRevisitTaskDTO faRevisitTask) throws SQLException {
		faRevisitTaskDao.update(faRevisitTask);
	}

	@Override
	public void updateForce(FaRevisitTaskDTO faRevisitTask) throws SQLException {
		faRevisitTaskDao.updateForce(faRevisitTask);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		faRevisitTaskDao.delete(id);
	}
	
	@Override
	public List<FaRevisitTaskDTO> queryList(FaRevisitTaskDTO faRevisitTask) throws SQLException {
		return faRevisitTaskDao.queryList(faRevisitTask);
	}

	@Override
	public int queryListCount(FaRevisitTaskDTO faRevisitTask) throws SQLException {
		return faRevisitTaskDao.queryListCount(faRevisitTask);
	}

	@Override
	public FaRevisitTaskDTO loadById(Integer id) throws SQLException {
		return faRevisitTaskDao.loadById(id);
	}
 	@Override
	public FaRevisitTaskDTO queryListGetFirst(FaRevisitTaskDTO faRevisitTask)
			throws SQLException {
		 List<FaRevisitTaskDTO> queryList = queryList(faRevisitTask);
		 if(queryList==null||queryList.size()==0){
			 return new FaRevisitTaskDTO();
		 }
		 return queryList.get(0);
	}
}
